import React, { memo } from "react";
import { Route, Link, useHistory } from "react-router-dom";
import { CollectArticleWrapper } from "./style";
import { getArticleDetail } from "@/service/index";
import { FAV_CATEGORY_ID } from "@/common/contants";
export default memo(function MyArticle(props) {
  const { articles } = props;
  const history = useHistory();
  console.log(articles);
 

  return (
    <CollectArticleWrapper>
      <div className="content">
        {articles.map((item, index) => {
          return (
            <Link
              key={item.id}
              className="fav-item"
              to={`/articleDetail?id=${item.id}&categoryId=${FAV_CATEGORY_ID}`}
              target="_blank"
            >
              <div className="fav-title">
                <div className="title">{item.title}</div>
              </div>
              <div className="fav-pic">
                <img src={item.pic} alt="" />
              </div>
            </Link>
          );
        })}
      </div>
    </CollectArticleWrapper>
  );
});
